function sttleAccountsSure() {
    var sttleAccountsHour = $("#sttleAccountsHour").val();
    var sttleAccountsMinute = $("#sttleAccountsMinute").val();
    var sttleAccountsSecond = $("#sttleAccountsSecond").val();
    var id = $("#id").val();
    $.ajax({
        url: Feng.ctxPath + "/dept/sttleAccountsTime",
        type: "post",
        data: {
            id: id,
            sttleAccountsHour: sttleAccountsHour,
            sttleAccountsMinute: sttleAccountsMinute,
            sttleAccountsSecond: sttleAccountsSecond
        },
        success: function (data) {
            Feng.success('操作成功!');
            window.parent.Dept.table.refresh();
            parent.layer.close(parent.layer.getFrameIndex(window.name));
        },
        error: function (data) {
            alert('没有权限，请联系系统管理员!');
            parent.layer.close(parent.layer.getFrameIndex(window.name));
        }
    })
}
//改变小时
function updateHour(obj) {
    var r = /^\+?[0-9][0-9]*$/;
    var sttleAccountsHour = document.getElementById("sttleAccountsHour").value;
    var flag = r.test(sttleAccountsHour);
    if (flag) {
        if (parseInt(sttleAccountsHour) > 24) {
            document.getElementById("sttleAccountsHour").value = document.getElementById("hour").value;
        } else {
            document.getElementById("hour").value = document.getElementById("sttleAccountsHour").value;
        }
    } else {
        document.getElementById("sttleAccountsHour").value = "00";
        document.getElementById("hour").value = "00";
    }
}
//改变小时
function updateHours(obj) {
    var r = /^\+?[0-9][0-9]*$/;
    var sttleAccountsHour = document.getElementById("sttleAccountsHour").value;
    var flag = r.test(sttleAccountsHour);
    if (flag) {
        if (parseInt(sttleAccountsHour) < 10 && sttleAccountsHour.length == 1) {
            document.getElementById("sttleAccountsHour").value = "0" + document.getElementById("sttleAccountsHour").value;
        }
    } else {
        document.getElementById("sttleAccountsHour").value = "00";
        document.getElementById("hour").value = "00";
    }
}
//改变分钟
function updateMinute(obj) {
    var r = /^\+?[0-9][0-9]*$/;
    var sttleAccountsMinute = document.getElementById("sttleAccountsMinute").value;
    var flag = r.test(sttleAccountsMinute);
    if (flag) {
        if (parseInt(sttleAccountsMinute) > 60) {
            document.getElementById("sttleAccountsMinute").value = document.getElementById("minute").value;
        } else {
            document.getElementById("minute").value = document.getElementById("sttleAccountsMinute").value;
        }
    } else {
        document.getElementById("sttleAccountsMinute").value = "00";
        document.getElementById("minute").value = "00";
    }
}
//改变分钟
function updateMinutes(obj) {
    var r = /^\+?[0-9][0-9]*$/;
    var sttleAccountsMinute = document.getElementById("sttleAccountsMinute").value;
    var flag = r.test(sttleAccountsMinute);
    if (flag) {
        if (parseInt(sttleAccountsMinute) < 10 && sttleAccountsMinute.length == 1) {
            document.getElementById("sttleAccountsMinute").value = "0" + document.getElementById("sttleAccountsMinute").value;
        }
    } else {
        document.getElementById("sttleAccountsMinute").value = "00";
        document.getElementById("minute").value = "00";
    }
}
//改变秒
function updateSecond(obj) {
    var r = /^\+?[0-9][0-9]*$/;
    var sttleAccountsSecond = document.getElementById("sttleAccountsSecond").value;
    var flag = r.test(sttleAccountsSecond);
    if (flag) {
        if (parseInt(sttleAccountsSecond) > 60) {
            document.getElementById("sttleAccountsSecond").value = document.getElementById("second").value;
        } else {
            document.getElementById("second").value = document.getElementById("sttleAccountsSecond").value;
        }
    } else {
        document.getElementById("sttleAccountsSecond").value = "00";
        document.getElementById("second").value = "00";
    }
}
//改变秒
function updateSeconds(obj) {
    var r = /^\+?[0-9][0-9]*$/;
    var sttleAccountsSecond = document.getElementById("sttleAccountsSecond").value;
    var flag = r.test(sttleAccountsSecond);
    if (flag) {
        if (parseInt(sttleAccountsSecond) < 10 && sttleAccountsSecond.length == 1) {
            document.getElementById("sttleAccountsSecond").value = "0" + document.getElementById("sttleAccountsSecond").value;
        }
    } else {
        document.getElementById("sttleAccountsSecond").value = "00";
        document.getElementById("second").value = "00";
    }
}